#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(){
	char*str;

	str = (char*) calloc(20,sizeof(char));
	
	printf("Nhap xau: ");
	gets(str);
	char tmp[10];
	int i = 0;
	int count = 0;
	while(i < strlen(str)-1){
		while(str[i] == ' '){
			i++;
		}
		int j = 0;
		while(str[i] != ' ' && i < strlen(str) -1){
			tmp[j] = str[i];
			j++;
			i++;
		}
		tmp[j] = '\0';
		puts(tmp);
		count ++;
	}
	printf("\n So tu trong cau: %d",count);
	getch(); 
}
